<%@ page language="java" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!doctype html>
<html lang="en">
<!-- 存款主界面 -->
<head>
	<title>Home</title>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
	<!-- VENDOR CSS -->
	<link rel="stylesheet" href="assets/vendor/bootstrap/css/bootstrap.min.css">
	<link rel="stylesheet" href="assets/vendor/font-awesome/css/font-awesome.min.css">
	<link rel="stylesheet" href="assets/vendor/linearicons/style.css">
	<link rel="stylesheet" href="assets/vendor/chartist/css/chartist-custom.css">
	<!-- MAIN CSS -->
	<link rel="stylesheet" href="assets/css/main.css">
	<!-- FOR DEMO PURPOSES ONLY. You should remove this in your project -->
	<link rel="stylesheet" href="assets/css/demo.css">
	<!-- GOOGLE FONTS -->
	<link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700" rel="stylesheet">
	<!-- ICONS -->
	<link rel="apple-touch-icon" sizes="76x76" href="assets/img/apple-icon.png">
	<link rel="icon" type="image/png" sizes="96x96" href="assets/img/favicon.png">
</head>

<body>
		
		<jsp:include page="/assets/jsp/header.jsp" flush="true"/>
		<jsp:include page="/assets/jsp/menu.jsp" flush="true"/>
		<!-- MAIN -->
		<div class="main">
			<!-- MAIN CONTENT -->
				<form class="form-horizontal" role="form" action="##" id="form6"
			method="post">
			<fieldset>
				<legend></legend>
				<div class="form-group">
					<label class="col-sm-2 control-label" for="accont_number">账号</label>
					<div class="col-sm-4">
						<input class="form-control" id="accont_number"
							name="accont_number" onchange="queryAccountInfo();" type="text"
							placeholder="请输入账号" />
					</div>

					<label class="col-sm-2 control-label" for="currency">货币代号</label>
					<div class="col-sm-4">
						<select id="currency" name="currency"
							class="form-control" readonly="readonly">
							<option value="01">01-人民币</option>
							<option value="02">02-美元</option>
							<option value="03">03-日元</option>
							<option value="04">04-英镑</option>
						</select>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label" for="senior_oir">营业机构号</label>
					<div class="col-sm-4">
						<input class="form-control" id="senior_oir" name="senior_oir"
							type="text" readonly="readonly"/>
					</div>
					<label class="col-sm-2 control-label" for="accounting_ori">帐务机构</label>
					<div class="col-sm-4">
						<input class="form-control" id="accounting_ori"
							name="accounting_ori" type="text" readonly="readonly" />
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label" for="balance">账户余额</label>
					<div class="col-sm-4">
						<input class="form-control" id="balance" name="balance" type="text"  onBlur="overFormat(this)"    />
					</div>
					<label class="col-sm-2 control-label" for="customer_number">客户编号</label>
					<div class="col-sm-4">
						<input class="form-control" id="customer_number"
							name="customer_number" type="text" readonly="readonly" />
					</div>
				<div class="form-group">
					<label class="col-sm-2 control-label" for="customer_name">客户名称</label>
					<div class="col-sm-4">
						<input class="form-control" id="customer_name" name="customer_name"
							type="text" readonly="readonly" />
					</div>
				</div>
				<div class="form-group">
						<label class="col-sm-2 control-label" for="amount">交易金额</label>
					<div class="col-sm-4">
						<input class="form-control" id="amount" name="amount" type="text" onBlur="overFormat(this)"    />
					</div>
				<!-- 柜员代号 -->	<input  id="teller" name="teller" type="hidden" value="<% out.print( session.getAttribute("session_user_id")); %>"/>  
				<!-- 帐务机构 -->	<input  id="trans_ori" name="trans_ori" type="hidden" value="<% out.print( session.getAttribute("session_user_ori")); %>"/>   	
				<!-- 交易日期 --> <input  id="work_date" name="work_date" type="hidden" value="<% out.print( session.getAttribute("session_work_date")); %>"/>
				<!-- 交易码 --> <input  id="trans_code" name="trans_code" type="hidden" value="4001"/>
					<label class="col-sm-2 control-label" for="trans_password">交易密码</label>
					<div class="col-sm-4">
						<input class="form-control" id="trans_password"
							name="trans_password" type="password"   maxlength="6" />
					</div>
				</div>

			</fieldset>
			<fieldset>
				<legend></legend>
				<div class="form-group">
					<label class="col-sm-2 control-label" for="submit"></label>
					<div class="col-sm-4">
						<input type="button" class="btn btn-default" onclick="doDepositConfirm();"
							value="提交" />
					</div>
				</div>
			</fieldset>
		</form>
				
			<!-- END MAIN CONTENT -->
		</div>
		<!-- END MAIN -->
		<div class="clearfix">
		<footer>
			<div class="container-fluid">
				<p class="copyright">Copyright &copy; 2018.Company  Shanbrain-bankli  All rights reserved.More Templates </p>
			</div>
		</footer>
	 </div>
	</div>
	<!-- END WRAPPER -->
	<!-- Javascript -->
	<script src="assets/vendor/jquery/jquery.min.js"></script>
	<script src="assets/vendor/bootstrap/js/bootstrap.min.js"></script>
	<script src="assets/vendor/jquery-slimscroll/jquery.slimscroll.min.js"></script>
	<script src="assets/vendor/jquery.easy-pie-chart/jquery.easypiechart.min.js"></script>
	<script src="assets/vendor/chartist/js/chartist.min.js"></script>
	<script src="assets/scripts/klorofil-common.js"></script>
	<script src="assets/scripts/common.js"></script>
	<script src="assets/scripts/base_function.js"></script>
	
	<script type="text/javascript">
	$("#subPages2").addClass("in");
	function queryAccountInfo(){
		var account_info;
		var account_info=queryAccount($("#accont_number").val());
		fillField(account_info);
	}
	function fillField(param) {
		$("#accont_number").attr("accont_number", true);
		$("#currency").val(param.currency);
		$("#senior_oir").val(param.senior_oir);
		$("#accounting_ori").val(param.accounting_ori);
		$("#balance").val(param.balance);
		$("#customer_name").val(param.customer_name);
	}
	function doDepositConfirm(){
		$.MsgBox.Confirm("温馨提示","存款确认", doDeposit);
	 }
		function doDeposit(){
		var data = new Object();
		data.accont_number = $("#accont_number").val();
		data.currency = $("#currency").val();
		data.senior_oir = $("#senior_oir").val();
		data.accounting_ori = $("#accounting_ori").val();
		data.balance = $("#balance").val();
		data.customer_number = $("#customer_number").val();
		data.customer_name = $("#customer_name").val();
		data.amount = $("#amount").val();
		data.teller = $("#teller").val();
		data.trans_ori = $("#trans_ori").val();
		data.accont_number = $("#accont_number").val();
		data.trans_code = $("#trans_code").val();

		$.ajax({
			type: "POST",//方法类型
            dataType: "json",//预期服务器返回的数据类型
            contentType : "application/json",
            url: "/brain-bank/doDeposit.do" ,//url
            data: JSON.stringify(data),
	 		success:function(result){
	 			if(result.returncode=="success"){
	       		 	$.MsgBox.Confirm("温馨提示", "交易成功", function(){window.location.href="/brain-bank/deposit.do";});
	 			}
	 			if(result.returncode=="failed"){
	       		 	$.MsgBox.Alert("温馨提示", "交易失败:"+result.msg);
	 			}
	 		},
	 		error: function(XMLHttpRequest, textStatus, errorThrown){
            	alert("执行失败");
                
             }
	 	});
	}

	
	</script>

</body>

</html>
